var orderVm;
var pageIndex=0;
var pageSize=50;
var getDataListHttp;
$(function(){

    getDataListHttp=function(isRefresh){
        _getHttpsData2('/enterprise/listByIsWaterPoint?isWaterPoint=1','',
           function(res){
               orderVm.enterList=res
			   orderVm.finished=true
           },
           function(err){         	
                vant.Toast.fail("网络异常"+err.readyState+":"+err.statusText+"("+err.status+")");
           }
       );
    }
 	
	initList=function(){
		orderVm.orderList=[];
	    var param="?string="+orderVm.keywords;
	    _getHttpsData2('/enterprise/listByLike'+param,'',
	       function(res){
	            console.log(param+JSON.stringify(res));
			    orderVm.enterList=res
			    orderVm.finished=true
	       },
	       function(err){
	            vant.Toast.fail("网络异常"+err.readyState+":"+err.statusText+"("+err.status+")");
	            orderVm.loading = false;
	            orderVm.finished = true;
	       }
	   );
	}

    orderVm = new Vue({
        el:'#order_id',
        data:{          
			keywords:'',
			loading: false,
			finished: false,
			refreshing: true,
            enterList:[]
        },
        methods:{
            onLoad:function(){
				getDataListHttp()
            },
            onRefresh:function(){
                this.refreshing=true;
                // 清空列表数据
                this.finished = false;
                // 重新加载数据
                // 将 loading 设置为 true，表示处于加载状态
                this.loading = true;
                this.onLoad();
            },
        }
    });
});

function openLink(index){
    var ep = orderVm.enterList[index];
    parent.location.href="../shop/shop_detail.html?id=" + ep.enterpriseId;
}